package org.swim.web.servlet.consts;

import net.sf.json.JsonConfig;

import org.swim.web.utils.JsonUtils;

public class SearchAttr {

	public static String WHAT = "what";
	public static String QUERY = "query";
	public static String ABILITIES = "abilities";

	public static JsonConfig JSONCFG;

	static {
		JSONCFG = JsonUtils.createJsonParamsFilter(QUERY, ABILITIES);

		JSONCFG.registerJsonValueProcessor(String[].class,
				JsonUtils.getJvpStringArrToString("abilities"));
	}

	public static enum What {
		ABILITY, FRIEND;

		public String value() {
			return super.name().toLowerCase();
		};
		
		public String request() {
			return WHAT + "=" + value();
		}

	}
}